﻿/* ***************************************************************************
 *  This file is part of the C# port of the Invivo AI challenge simulation environment.
 *  Copyright 2010 Colin Green
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program .  If not, see <http://www.gnu.org/licenses/>.
 * 
 * 
 * This file incorporates open sourced work authored by the following people:
 *
 *   Copyright (c) 2009 Simon Funk
 */
using Box2DX.Common;

namespace FunkAIChallenge
{
    /// <summary>
    /// Collection of parameters relevant to construction of a SimulationWorld.
    /// </summary>
    public class SimulationParameters
    {
        /// <summary>
        /// Lower and upper bounds that define the simulated world rectangle/area.
        /// </summary>
        public Vec2 _lowerBound;
        /// <summary>
        /// Lower and upper bounds that define the simulated world rectangle/area.
        /// </summary>
        public Vec2 _upperBound;
        /// <summary>
        /// World gravity, e.g. -9.8. (+ve Y is up).
        /// </summary>
        public float _gravity;
        /// <summary>
        /// Update rate in Hertz. Inverse of the simulation timestep increment, e.g. 60Hz = 16ms timestep.
        /// </summary>
        public int _frameRate;
        /// <summary>
        /// See _frameRate.
        /// </summary>
        public float _timeStep;
        /// <summary>
        /// Box2d velocity constraint solver iterations per loop.
        /// </summary>
        public int _velocityIters = 10;
        /// <summary>
        /// Box2d position constraint solver iterations per loop.
        /// </summary>
        public int _positionIters = 8;
        /// <summary>
        /// Initial position of ball.
        /// </summary>
        public Vec2 _ballPos;
        /// <summary>
        /// Initial velocity vector of ball.
        /// </summary>
        public Vec2 _ballVelocity;

        #region Constructor

        /// <summary>
        /// Construct with default parameter values.
        /// </summary>
        public SimulationParameters()
        {
            _lowerBound = new Vec2(-11f, -5f);
            _upperBound = new Vec2(11f, 11f);

            _gravity = -9.8f;
            _frameRate = 60;
            _timeStep = 1f / _frameRate;

            _ballPos = new Vec2(9, 5);
            _ballVelocity = new Vec2(-5f, 0);
        }

        #endregion
    }
}
